-
Notifications
You must be signed in to change notification settings - Fork 0
Finalize Beekeeper API #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR finalizes the Beekeeper API integration by adding comprehensive support for post creation within streams, implementing test mocking infrastructure, and cleaning up the authentication user status configuration.
- Added complete implementation for creating posts in streams with all optional parameters (files, polls, scheduling, etc.)
- Introduced Saloon HTTP request mocking across all feature tests
- Removed deprecated Reaction DTO and simplified AuthenticatedUserStatus configuration
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Requests/CreateAPostInAGivenStreamRequestTest.php | New unit tests for post creation request validation and data mapping |
| tests/Feature/Requests/CreateAPostInAGivenStreamRequestTest.php | New feature tests for post creation with mocked API responses |
| tests/Feature/Requests/UploadAFileRequestTest.php | Added Saloon mocking to file upload tests |
| tests/Feature/Requests/ListArtifactsRequestTest.php | Added Saloon mocking to artifact listing tests |
| tests/Feature/Requests/GetStatusOfAuthenticatedUserRequestTest.php | Added Saloon mocking and removed reactions assertion |
| tests/Feature/Requests/CreateAChildToAnArtifactRequestTest.php | Added Saloon mocking to artifact child creation tests |
| tests/TestCase.php | Added SaloonServiceProvider for test mocking support |
| src/Requests/CreateAPostInAGivenStream.php | New request class for creating posts in streams |
| src/Responses/CreateAPostInAGivenStreamResponse.php | New response handler for post creation |
| src/Data/Streams/Post.php | New DTO for post data with comprehensive field mapping |
| src/Data/Streams/Stream.php | New DTO for stream data |
| src/Enums/Streams/Type.php | New enum for stream types |
| src/Data/Configs/General.php | Made companyAccount nullable |
| src/Data/Configs/AuthenticatedUserStatus.php | Removed reactions field |
| src/Data/Configs/Reaction.php | Deleted deprecated DTO |
| README.md | Updated documentation with post creation examples and enum references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| throw new Exception( | ||
| sprintf( | ||
| '%s: %s - %s', | ||
| 'Request was not successful: ', |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message format contains redundant punctuation. Line 28 ends with ': ' which creates 'Request was not successful: : CODE' in the output. Remove the trailing colon and space from line 28.
| 'Request was not successful: ', | |
| 'Request was not successful', |
| return [ | ||
| 'expand' => implode(',', $expand), | ||
| ]; |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When expand is an empty array, this returns 'expand' => '', which may send an unnecessary empty query parameter. Consider filtering the query array to exclude empty values or checking if expand is empty before adding it to the return array.
| return [ | |
| 'expand' => implode(',', $expand), | |
| ]; | |
| if (!empty($expand)) { | |
| return [ | |
| 'expand' => implode(',', $expand), | |
| ]; | |
| } | |
| return []; |
| ]; | ||
| } | ||
|
|
||
| public function defaultBody(): array |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaultBody method contains significant code duplication with repeated patterns for converting Collections to arrays (lines 66-70, 92-96, 102-106, 112-116, 122-126, 132-136). Consider extracting this logic into a private helper method like 'convertToArray($value)' to reduce duplication and improve maintainability.
No description provided.